<%@page import="multiface.awwadco.jpa.Utente"%>
<style type="text/css">
    .des_hp{display: none}
</style>
<script type="text/javascript">
    $("#homepage").live('click',function() {
        if($("#homepage").attr('checked') == "checked"){
            $(".des_hp").fadeIn(400);
        }else{
            $(".des_hp").fadeOut(400);
        }
    });
    
    $(document).ready(function(){
        $("#formBox").validate();
        nicEditors.allTextAreas({buttonList : ['bold','italic','underline','ul','ol']});
    });
</script>

<%@page import="multiface.web.util.PagerList"%>
<%@page import="javax.persistence.Query"%>
<%@page import="java.util.LinkedList"%>

<%
    Utente ut = (Utente) session.getAttribute("admin");
    if (ut == null) {
        response.sendRedirect(multiface.web.util.ServletUtils.getBaseUrl(request) + "/admin/index.jsp?err=y");
    }
%>

<script type="text/javascript">
    $(document).ready(function(){
        $("#formBox").validate();
    });
</script>

<%@page import="java.util.Iterator"%>
<%@page import="multiface.awwadco.jpa.News"%>
<%@page import="java.util.List"%>
<%@page import="javax.persistence.RollbackException"%>
<%@page import="javax.persistence.EntityManager"%>
<%@page import="javax.persistence.Persistence"%>
<%@page import="javax.persistence.EntityManagerFactory"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>

<div class="box">
    <form class="formBox" id="formBox" method="post" action="">
        <div class="title">Add New News</div>
        <br>
        <div class="inputs">
            <label for="titolo">Title of the News</label>
            <input name="titolo" id="titolo" maxlength="255" class="required" type="text"/>
        </div>

        <div class="inputs">
            <label style="height:50px;margin-right: 6px;" for="testo">Text of the News</label>
            <textarea cols="100" style="height:200px;" name="testo" id="testo"></textarea>
        </div>

        <input name="utente" id="utente" type="hidden" value="<%=ut%>"/>
    </form>
</div>